<!doctype html>
[#escape x as (x)!?html]
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<title>留言板 - ${site.fullNameOrName}${global.customs['poweredBy']}</title>
	<meta name="keywords" content="留言板">
	<meta name="description" content="留言板">
	[#include 'inc_meta.html'/]
	[#include 'inc_css.html'/]
	[#include 'inc_js.html'/]
</head>
<body>
[#include 'inc_header.html'/]
<div class="container">
	<div class="row">
		<div class="col mt-1">
			<div class="d-flex align-items-center py-1 border-bottom">
                <div class="flex-grow-1 h5 mb-0"><a href="${dy}/guestbook">留言板</a></div>
                <div><a class="btn btn-primary" href="${dy}/guestbook/create" role="button">我要留言</a></div>
            </div>
            <div class="py-1 border-bottom">
                <a href="${addParam('','isReply')}" class="btn btn-sm [#if !Param.isReply??]btn-secondary[#else]btn-link text-reset[/#if]">全部留言</a>
                <a href="${addParam('','isReply','true')}" class="btn btn-sm [#if Param.isReply! =='true']btn-secondary[#else]btn-link text-reset[/#if]">已回复留言</a>
                <a href="${addParam('','isReply','false')}" class="btn btn-sm [#if Param.isReply! =='false']btn-secondary[#else]btn-link text-reset[/#if]">未回复留言</a>
            </div>
            <div class="py-1 border-bottom">
                [@GuestbookTypeList;list]
                <a href="${addParam('','typeId')}" class="btn btn-sm [#if !Param.typeId??]btn-secondary[#else]btn-link text-reset[/#if]">全部类别</a>
                [#list list as type]
                <a href="${addParam('','typeId',type.id)}" class="btn btn-sm [#if Param.typeId! == type.id?string]btn-secondary[#else]btn-link text-reset[/#if]">${type.name}</a>
                [/#list]
                [/@GuestbookTypeList]
            </div>
            [@GuestbookPage typeId=Param.typeId isReply=Param.isReply limit='10' sort="creationDate desc";pagedList]
            <ul class="list-unstyled">
                [#list pagedList.content as bean]
                <li class="mt-3 pb-3 border-bottom position-relative">
                    <div class="d-flex align-items-center">
                        <div class="badge badge-info mr-2">${bean.type.name}</div>
                        <div class="flex-grow-1 text-truncate"><a href="${dy}/guestbook/${bean.id}" class="text-reset stretched-link">${bean.title!substring(bean.text,100,'...')}</a></div>
                        <div>[#if bean.reply]<span class="badge badge-success">已回复</span>[#else]<span class="badge badge-secondary">未回复</span>[/#if]</div>
                    </div>
                    <p class="small text-muted my-2 cm-truncate2">${substring(bean.text,400,'...')}</p>
                    <div class="small text-black-50 mt-2 clearfix">
                        <div class="float-left"><i class="far fa-user"></i> ${bean.creator.username!bean.username!"匿名网友"}</div>
                        <div class="float-right"><i class="ml-2 far fa-clock"></i> ${bean.creationDate?string('yyyy-MM-dd')}</div>
                    </div>
                </li>
                [/#list]
            </ul>
            [#include 'page.html'/]
            [/@GuestbookPage]
		</div>
	</div>
</div>
[#include 'inc_footer.html'/]
</body>
</html>
[/#escape]

